package com.gray.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTime {
	public static String getTimeFormat(){
	    Date date = new Date();
	    long times = date.getTime();//时间戳
	    System.out.println(times);
	    SimpleDateFormat formatter = new SimpleDateFormat("MM-dd-HH:mm:ss");
	    String dateString = formatter.format(date);
	    System.out.println(dateString);
	    return dateString;
	}
	public static void main(String[] args) {
		getTimeFormat();
	}
}
